#include "../include/StringStack.h"
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
StringStack::StringStack() : index(0)
{
    memset(stack, 0, size * sizeof(string *));
}

void StringStack::push(const string *s)
{
    if (index < size)
    {
        stack[index++] = s;
    }
}

const string *StringStack::pop()
{
    if (index > 0)
    {
        const string *rv = stack[--index];
        stack[index] = 0;
        return rv;
    }
    return 0;
}
StringStack::~StringStack(){
    cout << "freeing" <<endl;
}
